package de.mizi.ui.statusbox;

import java.awt.Graphics;

/**
 * This class represents a StatusBoxContent object that consists
 * of a label and a single value.
 * @author mizi
 *
 */
public class SingleValueContent extends LabelOnlyContent {
	protected int value;
	
	/**
	 * Constructs a concrete StatusBoxContent object with the given position
	 * relative to the position of the StatusBox object this object belongs to.
	 * This StatusBoxContent object has a label and a single value.
	 * @param relativeX the relative x position
	 * @param relativeY the relative y position
	 * @param label the label
	 * @param value the value
	 */
	public SingleValueContent(int relativeX, int relativeY, String label, int value) {
		super(relativeX, relativeY, label);
		this.value = value;
	}
	
	/**
	 * Get the value of this StatusBoxContent object.
	 * @return the value
	 */
	public int getValue() {
		return value;
	}

	/**
	 * Set the value of this StatusBoxContent object.
	 * @param value the new value
	 */
	public void setValue(int value) {
		this.value = value;
	}

	@Override
	public void render(Graphics g, int yOffset) {
		g.drawString(label + value, relativeX, relativeY - yOffset);
	}
}
